BLT's Garden

A raised garden bed with an automated watering system using an Arduino UNO R4 WiFi and MQTT protocol.


Component List:

• Arduino UNO R4 WiFi
• 12V submersible water pump + added in-line filter
• 5V relay
• 1/2" tubing for the mainline
• 1/4" tubing for jumps from the mainline to the micro bubblers/sprayers
• Sparkfun soil moisture sensors

The Arduino controls the water pump, and I currently have it set to water at 9:00AM pacific time. I used NTP (network time protocol) to control the clock. It currently waters about 15 minutes earlier (at 8:45AM), which I will have to debug later. There are also 3x soil moisture sensors attached, these go to the two tomato plants and the jalapeƱo plant. They are currently not mapped accurately, and overall just aren't the most accurate reading.

I am also sending data to my Shiftr.io broker like this:

"{\"state\":\"" + stateVal +
"\",\"moisture1\":" + String(map(analogRead(soil1Pin), 350, 880, 0, 100)) +
",\"moisture2\":" + String(map(analogRead(soil2Pin), 350, 880, 0, 100)) +
",\"moisture3\":" + String(map(analogRead(soil3Pin), 350, 880, 0, 100)) + "}";




On the webpage side, I use javascript to parse out the data and display them in the browser. You can visit the webpage here. It will also keep a brief recent history as long as the page isn't refreshed.

The webpage also has the option to manually water for x amount of seconds. Anyone with the password can send a message to the broker which gets read by Arduino to specify a specific amount of seconds to water, outside of the preset watering times.

Below is the overall flow of the system: